import {TeacherList} from "/@/api/teacher/teacher";

export interface GrowCardItem {
  icon: string;
  title: string;
  value: number;
  total: number;
  color: string;
  action: string;
  unit: string;
}

const teacherList = await TeacherList();

let jxks_max = 0;
let jkyjf_max = 0;
let jkyjsjf_max = 0;
let glyggfwjf_max = 0;

let jxks_total = 0;
let jkyjf_total = 0;
let jkyjsjf_total = 0;
let glyggfwjf_total = 0;
console.log('teacherList',teacherList)
teacherList.forEach(f => {
  jxks_total +=  parseFloat(f.jxks);
  jkyjf_total +=  parseFloat(f.jkyjf);
  jkyjsjf_total +=  parseFloat(f.jkyjsjf);
  glyggfwjf_total +=  parseFloat(f.glyggfwjf);

  jxks_max +=  parseFloat(f.jxks_full_mark);
  jkyjf_max +=  parseFloat(f.jkyjf_full_mark);
  jkyjsjf_max +=  parseFloat(f.jkyjsjf_full_mark);
  glyggfwjf_max +=  parseFloat(f.glyggfwjf_full_mark);
});
export const growCardList: GrowCardItem[] = [
  {
    title: '教学类',
    icon: 'visit-count|svg',
    value: jxks_total,
    total: jxks_max,
    color: 'green',
    action: '已发放课时数 / 总课时数',
    unit: '课时'
  },
  {
    title: '教科研',
    icon: 'total-sales|svg',
    value: jkyjf_total,
    total: jkyjf_max,
    color: 'blue',
    action: '已发放课时数 / 总课时数',
    unit: '积分',
  },
  {
    title: '教科研建设',
    icon: 'download-count|svg',
    value: jkyjsjf_total,
    total: jkyjsjf_max,
    color: 'orange',
    action: ' 已发放课时数 / 总课时数',
    unit: '积分',
  },
  {
    title: '管理与服务',
    icon: 'transaction|svg',
    value: glyggfwjf_total,
    total: glyggfwjf_max,
    color: 'purple',
    action: ' 已发放课时数 / 总课时数',
    unit: '积分',
  },
];
